package com.ruoyi.web.dao.sys;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.domain.sys.UserCredentialEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Jrx
 */
@Mapper
public interface UserCredentialDao extends BaseMapper<UserCredentialEntity> {

    @Select("select * from sys_user_credential where id=#{id}")
    public UserCredentialEntity selectById(int id);

    @Insert(" INSERT INTO sys_user_credential \n" +
            "        (userid,username, password, salt, passkey, check_code, totp, reg_ip, reg_type)\n" +
            "        VALUES \n" +
            "        (#{userid},#{username}, #{password}, #{salt}, #{passkey}, #{checkCode}, #{totp}, #{regIp}, #{regType})")
    int insert(UserCredentialEntity entity);


    @Select("select * from sys_user_credential where userid=#{id}")
    UserCredentialEntity getById(Integer id);
}
